package base.day07;

import javax.swing.*;

public class study3 {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setTitle("猜数字");
        jf.setSize(400, 300);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setAlwaysOnTop(true);
        jf.setLayout(null);

        //文字说明
        JLabel gameRules = new JLabel("系统产生了一个1-100之间的随机数，请猜一猜");
        gameRules.setBounds(70, 50, 350, 20);
        jf.add(gameRules);

        //显示输入的文本框
        JTextField enterField = new JTextField();
        enterField.setBounds(120, 100, 150, 20);
        jf.add(enterField);

        //显示按钮
        JButton button = new JButton("猜测");
        button.setBounds(150, 150, 100, 20);
        jf.add(button);

        jf.setVisible(true);
    }
}
